package com.leruan.aasimp.entity;

public enum UserTypeEnumEntity {
    // 1:管理员用户,2:汽车主,3:汽车销售商,4:汽车制造商,5:保险公司,6:维修公司,7:汽车美容（保养）公司,8:交警,9:配件销售商,10:维修工
	SYSUSER(1), CARUSER(2), CARSELLER(3), CARMACKER(4),INSURER(5),MAINTAIN(6),CARBEAUTY(7),POLICEMAN(8),ACCESSORYVENDORS(9),WXPERSON(10);



    private int value;
    UserTypeEnumEntity(int value){
    	this.value = value;
    }

    public static UserTypeEnumEntity valueOf(int value) {
    	UserTypeEnumEntity type = null;
        switch (value) {
        case 1:
            type = SYSUSER;
            break;
        case 2:
            type = CARUSER;
            break;
        case 3:
            type = CARSELLER;
            break;
        case 4:
            type = CARMACKER;
            break;
        case 5:
            type = INSURER;
            break;
        case 6:
            type = MAINTAIN;
            break;
        case 7:
            type = CARBEAUTY;
            break;
        case 8:
            type = POLICEMAN;
            break;
        case 9:
            type = ACCESSORYVENDORS;
            break;
        case 10:
        	type = WXPERSON;
        	break;
        default:
            break;
        }
        return type;
    }

    public String getDescription() {
        String desc = "";
        switch (value) {
        case 1:
            desc = "管理员用户";
            break;
        case 2:
            desc = "汽车主";
            break;
        case 3:
            desc = "汽车销售商";
            break;
        case 4:
            desc = "汽车制造商";
            break;
        case 5:
            desc = "保险公司";
            break;
        case 6:
            desc = "维修公司";
            break;
        case 7:
            desc = "汽车美容（保养）公司";
            break;
        case 8:
            desc = "交警";
            break;
        case 9:
            desc = "配件销售商";
            break;
        case 10:
        	desc = "维修工";
        	break;
        default:
            break;
        }
        return desc;
    }

    @Override
    public String toString() {
        return getDescription();
    }

    public boolean equals(UserTypeEnumEntity type) {
        if (type == null) {
            return false;
        }
        return this.value == type.value;
    }

    public int getValue() {
        return value;
    }
}
